<!DOCTYPE html>
<html xmlns:v="urn:schemas-microsoft-com:vml">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <title>流程图-导出图片</title>
    <!--[if lt IE 9]>
    <?import namespace="v" implementation="#default#VML" ?>
    <script type="text/javascript" src="https://cdn.bootcss.com/json2/20160511/json2.min.js"></script>
    <![endif]-->
    <link rel="shortcut icon" href="../assets/img/favicon.png" type="image/x-icon"/>
    <link rel="stylesheet" type="text/css" href="../dist/GooFlow.min.css"/>
</head>
<body>
<div id="demo" style="margin:10px"></div>
<div id="fff"></div>
<script src="../assets/js/demo_export.js"></script>
<script type="text/javascript">
    //初始化前的公用方法：修改默认的颜色
    GooFlow.setColors({
        lineFont:"#ff6600",
    });
    var property={
        auth:auth,
        width:1200,
        height:540,
        toolBtns:["start round mix","end round","task","node","chat","state","plug","join","fork","complex mix"],
        haveHead:true,
        headLabel:true,
        headBtns:["new","open","save","undo","redo","reload","print"],//如果haveHead=true，则定义HEAD区的按钮
        headBtnEvents:{},//如果headBtns有值，则定义每个自定义类型按钮的事件
        haveTool:true,
		haveDirDashed:true,
		haveSegment:true,
		haveSegDashed:true,
        haveGroup:true,
        useOperStack:true
    };
    var remark={
        cursor:"选择指针",
        direct:"有向连线",
        dirDashed:"有向虚线",
		segment:"无向连线",
		dirDashed:"无向虚线",
        start:"入口结点",
        "end":"结束结点",
        "task":"任务结点",
        node:"自动结点",
        chat:"决策结点",
        state:"状态结点",
        plug:"附加插件",
        fork:"分支结点",
        "join":"联合结点",
        "complex":"复合结点",
        group:"组织划分框编辑开关"
    };
    //顶部标题栏按钮的title提示设置，每个key名与初始化配置中相应按钮的类型名相同
    var headBtns={
        'new':"新建流程",
        open:"打开流程",
        save:"保存结果",
        undo:"撤销",
        redo:"重做",
        reload:"刷新流程",
        print:"打印流程图"
    };
    //工作区域面积扩展按钮的title提示设置
    var extRemarks={
        extendRight:"工作区向右扩展",
        extendBottom:"工作区向下扩展"
    }
    var demo;
    $(function(){
        var exportName="fuckyou";
        //demo=$.createGooFlow($("#demo"),property);
        demo=GooFlow.init("#demo",property);
        demo.setNodeRemarks(remark);
        demo.setHeadToolsRemarks(headBtns);
        demo.setExtWorkRemarks(extRemarks);
        demo.loadData(jsondata);
        demo.onBtnSaveClick=function(){
            demo.exportDiagram(exportName);//流程图导出图片功能
        }
        demo.onPrintClick=function(){
            demo.print();//打印流程图或另存为PDF功能
        }
    });
</script>
</body>
</html>